#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int sb(unsigned int n)
{
	if (n > 9)
	{
		return sb(n / 10) + n % 10;
	}
	else
	{
		return n;
	}
}
int main()
{
	unsigned int n = 0;
	scanf("%u",& n);
	int sum = sb(n);
	printf("%d", sum);
	return 0;
}